<!-- <page-header-wrapper [title]="'企业审核列表'" [content]="content">
  <ng-template #content>
    <nz-tabset class="tabs-wrap">
      <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="changeTab(tab)"> </nz-tab>
    </nz-tabset>
  </ng-template>
</page-header-wrapper>
<nz-card class="mb-md">
  <div nz-row nzGutter="8">
    <div nz-col [nzXl]="_$expand ? 24 : 16" [nzLg]="24" [nzSm]="24" [nzXs]="24">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzXl]="_$expand ? 24 : 8" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right"
      [class.expend-options]="_$expand">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
        [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-list']">查询</button>
      <button *ngIf="tabType == 1" nz-button nzType="primary" [disabled]="false" (click)="exportList()" acl
        [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-export']">导出</button>
      <button nz-button (click)="resetSF()" [disabled]="false">重置</button>
      <button nz-button nzType="link" (click)="expandToggle(!_$expand)">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->

<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"><label class="driver">|</label>企业审核列表</label>
  </div>
  <nz-tabset [nzTabBarExtraContent]="extraTemplate">
    <nz-tab nzTitle="企业审核" (nzSelect)="changeTab(1)">
      <st
        #entst
        multiSort
        [data]="service.$api_get_freight_list"
        [columns]="enterColumns"
        [req]="{ process: beforeReq }"
        [page]="{}"
        [loading]="false"
        [scroll]="{ x: '1200px', y: scrollY }"
      >
        <ng-template st-row="approvalStatus" let-item let-index="index">
          <ng-container [ngSwitch]="item.approvalStatus">
            <nz-badge *ngSwitchCase="10" nzColor="#108ee9" nzText="待审核"></nz-badge>
            <nz-badge *ngSwitchCase="15" nzColor="gold" nzText="已撤销"></nz-badge>
            <nz-badge *ngSwitchCase="20" nzColor="#87d068" nzText="已成功"></nz-badge>
            <ng-container *ngSwitchCase="30">
              <nz-badge nzColor="volcano" nzText="已驳回"></nz-badge><br />
              <label style="color: #ff4d4f">（驳回原因：{{ item.approvalOpinion }}）</label>
            </ng-container>

            <p *ngSwitchDefault></p>
          </ng-container>
        </ng-template>
      </st>
    </nz-tab>
    <nz-tab nzTitle="企业管理员审核" (nzSelect)="changeTab(2)">
      <st
        #adminst
        multiSort
        [data]="service.$api_get_enterprise_admin_list"
        [columns]="adminColumns"
        [req]="{ process: beforeReq }"
        [page]="{}"
        [loading]="false"
        [scroll]="{ x: '1200px', y: scrollY }"
      >
        <ng-template st-row="approvalStatus" let-item let-index="index">
          <ng-container [ngSwitch]="item.approvalStatus">
            <nz-badge *ngSwitchCase="10" nzColor="#108ee9" nzText="待审核"></nz-badge>
            <nz-badge *ngSwitchCase="15" nzColor="gold" nzText="已撤销"></nz-badge>
            <nz-badge *ngSwitchCase="20" nzColor="#87d068" nzText="已成功"></nz-badge>
            <ng-container *ngSwitchCase="30">
              <nz-badge nzColor="volcano" nzText="已驳回"></nz-badge><br />
              <label style="color: #ff4d4f">（驳回原因：{{ item.approvalOpinion }}）</label>
            </ng-container>
            <p *ngSwitchDefault></p>
          </ng-container>
        </ng-template>
      </st>
    </nz-tab>
  </nz-tabset>

  <ng-template #extraTemplate>
    <div class="mr-sm">
      <button
        nz-button
        nzDanger
        [nzLoading]="service.http.loading"
        acl
        [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-list']"
        (click)="openDrawer()"
        >筛选</button
      >
      <button *ngIf="tabType == 1" nz-button nzDanger (click)="exportList()" acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-export']">
        导出</button
      >
    </div>
  </ng-template>
</nz-card>

<ng-template #approvedModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="120">
      <se [col]="1" label="公司名称">
        {{ detailData?.enterpriseName }}
      </se>
      <se [col]="1" label="网络货运人" required>
        <nz-select nzPlaceHolder="请选择" [(ngModel)]="networkTransporter">
          <nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of ltdId"></nz-option>
        </nz-select>
      </se>
      <se [col]="1" label="企业角色" required>
        <nz-select nzPlaceHolder="请选择" [(ngModel)]="roleId">
          <nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of roles"></nz-option>
        </nz-select>
      </se>
      <se [col]="1" label="客服人员" required>
        <nz-select nzPlaceHolder="请选择" [(ngModel)]="customerServiceId">
          <nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of customerServices"></nz-option>
        </nz-select>
      </se>
    </div>
  </div>
</ng-template>

<ng-template #redectModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="120">
      <se [col]="1" label="公司名称">
        {{ detailData?.enterpriseName }}
      </se>
      <se [col]="1" label="备注" required>
        <textarea nz-input rows="3" style="width: 325px; margin-left: 14px" [(ngModel)]="approvalOpinion"></textarea>
      </se>
    </div>
  </div>
</ng-template>
